#ifndef _BOARD_H_
#define _BOARD_H_

#include "app_config.h"
#include "mcu.h"

#define BSP_MCU_MODEL       POLSYS_MCU_KEIL_SIM_M0P


#define SRAM_SIZE      (128)      // KB

#define SRAM_END       (0x20000000 + SRAM_SIZE * 1024)

#if defined(__CC_ARM) || defined(__CLANG_ARM)
extern int Image$$RW_IRAM1$$ZI$$Limit;
#define HEAP_BEGIN      ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
#elif __ICCARM__
#pragma section="CSTACK"
#define HEAP_BEGIN      (__segment_end("CSTACK"))
#else
extern int __bss_end;
#define HEAP_BEGIN      ((void *)&__bss_end)
#endif

#define HEAP_END        ((void *)SRAM_END)



#if APP_DRIVE_SELECT == 1
#define RT_CONSOLE_DEVICE_NAME      "itm"
#define Board_InitConsoleDevice() RtHwItmInit()
#else
#define Board_InitConsoleDevice()
#endif

extern bool VirtualLed;

#define LED             VirtualLed    
#define Led_On()		LED = true
#define Led_Off()		LED = false
#define Led_Init()		
#define Led_IsOn()      LED

#define Board_GetTickCycleValue()   SYSTICK_VALUE
#define Board_GetTickNowValue()     (u32)(SYSTICK_VALUE - SysTick->VAL)


#endif
